/**
 * CommonHeader
 */

 var React = require("react");
 var CommonHeader = React.createClass({
    getInitialProps: function (){
        return {
            type: ""
        }
    },
    componentWillMount: function (){
        this.names = {
            shoppers: "导购信息",
            phone: "电话号码",
            website: "官网信息",
            address: "位置信息",
            video: "视频信息",
            search_nearby: "附近搜索"
        };
        this.name = this.names[this.props.type];

        var rootPath = "/static/new_version/image/recognize/";
        this.urls = {
            shoppers: rootPath + "guide.png",
            phone: rootPath + "phone.png",
            website: rootPath + "web.png",
            address: rootPath + "location.png",
            video: rootPath + "video.png",
            search_nearby: rootPath + "search.png"
        };
        this.url = this.urls[this.props.type];
    },
    render: function (){
        return (
            <div className="details-header">
                <img src={this.url} />
                <div className="title">{this.name}</div>
            </div>
        )
    }
 });

 module.exports = CommonHeader;
